﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace MageWars.GameElements
{
    public enum Team
    {
        TeamBlue,
        TeamOrange,
        None
    }

    public abstract class Movable
    {
        public Movable()
        {
            Position = Vector3.Zero;
            Direction = MathHelper.Pi + MathHelper.PiOver2;
        }

        public Rectangle BoundingBox
        {
            get
            {
                //return new Rectangle((int)Position.X, (int)Position.Y, CurrentTexture().Width, CurrentTexture().Height);
                return new Rectangle((int)Position.X, (int)Position.Y, CurrentTexture().Width/2, CurrentTexture().Height/2);
            }
        }

        public Team Group
        {
            get;
            set;
        }

        public abstract Texture2D CurrentTexture();
        public Vector3 Position { get; set; }

        private float _direction;

        /// <summary>
        /// Angle the Movable object is facing (in Radians)
        /// </summary>
        public float Direction
        {
            get
            {

                return _direction;
            }
            set
            {
                _direction = value % MathHelper.TwoPi;
            }
        }
    }
}